package com.nextbusmn.server.dataobjects;

import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;


@PersistenceCapable
public class BusStopData implements NextBusData {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
	private int stopID;
	
	@Persistent
	private String stopName;
	
	@Persistent
	private String stopDesc;
	
	@Persistent
	private double stopLat;
	
	@Persistent
	private double stopLon;
	
	@Persistent
	private Set<StopTimeData> stopTimeData;
	
	public BusStopData(int stopID,
						String stopName,
						String stopDesc,
						double stopLat,
						double stopLon) {
		
		this.stopID = stopID;
		this.stopName = stopName;
		this.stopDesc = stopDesc;
		this.stopLat = stopLat;
		this.stopLon = stopLon;
		this.stopTimeData = new HashSet<StopTimeData>();
	}

	public int getStopID() {
		return stopID;
	}

	public void setStopID(int stopID) {
		this.stopID = stopID;
	}

	public String getStopName() {
		return stopName;
	}

	public void setStopName(String stopName) {
		this.stopName = stopName;
	}

	public String getStopDesc() {
		return stopDesc;
	}

	public void setStopDesc(String stopDesc) {
		this.stopDesc = stopDesc;
	}

	public double getStopLat() {
		return stopLat;
	}

	public void setStopLat(double stopLat) {
		this.stopLat = stopLat;
	}

	public double getStopLon() {
		return stopLon;
	}

	public void setStopLon(double stopLon) {
		this.stopLon = stopLon;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}
	
	public void addStopTimeData(StopTimeData stopTime) {
		this.stopTimeData.add(stopTime);
	}
	
	public void setStopTimeData(Set<StopTimeData> stopTimeData) {
		this.stopTimeData = stopTimeData;
	}
	
	public Set<StopTimeData> getStopTimeData() {
		return this.stopTimeData;
	}
}
